<%@ page import="model.Student" %>
<%@ page import="java.util.List" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 张棋
  Date: 2024/8/2
  Time: 10:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
  List<Student> stulist = (List<Student>) request.getAttribute("stulist");
%>
<a href="logout">退出系统</a>
<h1>学生信息展示</h1>>
<table cellpadding ='3' cellspacing='0' border='1' align='center'>
  <tr>
    <th>学号</th>
    <th>姓名</th>
    <th>性别</th>
    <th>年龄</th>
    <th>专业</th>
    <th>时间</th>
    <th>操作1</th>
    <th>操作2</th>
  </tr>
  <c:forEach items="${requestScope.stulist}" var="Student">
  <tr>
    <td>${Student.id}</td>
    <td>${Student.name}</td>
    <td>${Student.sex}</td>
    <td>${Student.age}</td>
    <td>${Student.major}</td>
    <td>${Student.time}</td>
    <td onclick="if(confirm('确认删除吗？')){window.location.href='DelUser?id=${Student.id}'}else{return false;}">删除</td>
    <td onclick="if(confirm('确认更新吗？')){window.location.href='update?id=${Student.id}'}else{return false;}">更新</td>
  </tr>>
  </c:forEach>
</table>

</body>
</html>
